package com.aierkeji.b2c.entity.vo;

import java.math.BigDecimal;
import java.util.Date;

import com.aierkeji.b2c.constants.Contants;
import com.aierkeji.b2c.utils.DateTimeUtils;
import com.aierkeji.b2c.utils.PriceFormatter;
import com.fasterxml.jackson.annotation.JsonFormat;

public class ProductVo {

	private String id;
	private String alipayLifeId;
	private String name;
	private String img;
	private Double price;
	private String descript;
	private Long activationTime;
	
	private Date lastEnd;
	
	
	

	public ProductVo() {
		super();
	}

	public ProductVo(String id, String alipayLifeId, String name, String path,String fileName, BigDecimal price, String descript,Long activationTime) {
		super();
		this.id = id;
		this.alipayLifeId = alipayLifeId;
		this.name = name;
		this.img = Contants.USER_DATA_URL+path+fileName;
		this.price = PriceFormatter.getDefaultRounding(price.divide(BigDecimal.valueOf(100))).doubleValue();
		this.descript = descript;
		this.activationTime = activationTime;
		this.lastEnd = DateTimeUtils.addDay(new Date(), activationTime.intValue());
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAlipayLifeId() {
		return alipayLifeId;
	}

	public void setAlipayLifeId(String alipayLifeId) {
		this.alipayLifeId = alipayLifeId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getDescript() {
		return descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}

	public Long getActivationTime() {
		return activationTime;
	}

	public void setActivationTime(Long activationTime) {
		this.activationTime = activationTime;
	}

	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	public Date getLastEnd() {
		return lastEnd;
	}

	
	public void setLastEnd(Date lastEnd) {
		this.lastEnd = lastEnd;
	}
	

}
